<template>
  <el-button
    circle
    class="vxe-button type--button size--mini is--circle"
    title="导出"
    :loading="loading"
    @click="exportMethod"
  >
    <i class="vxe-button--icon vxe-icon--download"></i>
  </el-button>
</template>
<script>

export default {
  props: {
    //导出配置
    exportConfig: {
      type: Object,
      default() {
        return {
          url: "",
          params: {},
        };
      },
    },
  },
  data() {
    return {
      loading: false,
    };
  },
  methods: {
    exportMethod() {
      this.loading = true;
      this.util
        .downloadFile(this.exportConfig.url, this.exportConfig.params)
        .then((res) => {
          this.loading = false;
        });
    },
  },
};
</script>